
class fileOperate(object):
    def __init__(self,filePath,fileName,debugPrint):
        self.fileHander = None
        self.filepath =filePath
        self.fileName = fileName
        self.debugprint = debugPrint
        self.file = self.filepath + self.fileName

    
    def creatFileObjectRead(self):
        self.fileHander = open(self.file,"r")

    def creatFileObjectWrite(self):
        self.fileHander = open(self.file,"a")
        
    def fileWrite(self, message):
        status = self.fileHander.write(message)
        if self.debugprint == 1:
            print status
        return status
    
    def fileRead(self):
        data = self.fileHander.read()
        if self.debugprint == 1:
            print data
        return data
    
    def fileClose(self):
        self.fileHander.close()
        
        